#include <iostream>
using namespace std;

class FlyBehavior{
public:
    virtual void fly()=0;
};
class TakeOffBehavior{
public:
    virtual void takeoff()=0;
};
class SubsonicFly:public FlyBehavior{
public:
    void fly(){
        cout<<"SubsonicFly"<<endl;
    }
};
class SupersonicFly:public FlyBehavior{
public:
    void fly(){
        cout<<"SupersonicFly"<<endl;
    }
};
class VerticalTakeOff:public TakeOffBehavior{
    void takeoff(){
        cout<<"VerticalTakeOff"<<endl;
    }
};
class LongDistanceTakeOff:public TakeOffBehavior{
    void takeoff(){
        cout<<"LongDistanceTakeOff"<<endl;
    }
};
class Aircraft{
protected:
    FlyBehavior * flyBehavior;
    TakeOffBehavior * takeOffBehavior;
public:
    virtual void Fly()=0;
    virtual void Takeoff()=0;
};
class Airplane:public Aircraft{
public:
    Airplane(FlyBehavior * flyBehavior1,TakeOffBehavior * takeOffBehavior1){
        flyBehavior = flyBehavior1;
        takeOffBehavior = takeOffBehavior1;

    }
    void Fly(){
        flyBehavior->fly();
    }
    void Takeoff(){
        takeOffBehavior->takeoff();
    }
};
int main() {
    SubsonicFly * Ps = new SubsonicFly();
    LongDistanceTakeOff * Pl = new LongDistanceTakeOff();
    Aircraft * Pa = new Airplane(Ps,Pl);
    Pa->Fly();
    Pa->Takeoff();
}


